<link rel="stylesheet" href="/css/Module_searchresult/index.css">
<script src="/js/Module_searchresult/index.js"></script>
<?php if(count($researchs)>0):?>

<?php $tmp="" ?>

<?php echo count($researchs). " Records Found"?>
<div align="right">
<!--    <input type='checkbox' id='selectAllresult'> <span id="selectAllresulttitle">Select All</span>-->

    <table cellspacing="4">
    <tr>

        <td class="tdtool"><a id="selectAllresult" style="cursor: pointer" >Select All</a></td>
    
    <td class="tdtool"><a id="unselectAllresult" style="cursor: pointer">Unselect All</a></td>

    <td><a id="downloadexceldata" style="cursor: pointer" onclick="SaveSearchData();">Download Data </a></td>
    </tr>
   </table>
</div>
<?php foreach($researchs as $research):?>
<div id="divsearchdata" style="  height: 120px;">
        
    <table class="Search_Results"  name="Result_Table" id ="<?php echo $research->getId()?>" onclick="tbvalue(this)">
        <tr>
            <td>
                <?php echo ('<input type="checkbox" name="selectResult" id="selectResult_"'. $research->getId().'" value="'. $research->getId().'" onclick="setFilter(2)">') ?>
            </td>
            <td colspan="2" >
                <table width="100%"><tr><td><?php echo "<span class='title'>".$research->Species["species"]."</span>"?></td><td align="right"><a href="#" onclick="window.open('http://en.wikipedia.org/wiki/<?php echo $research->Species["species"] ?>')"><img width="24px" src='/images/wiki.png'/></a></td></tr></table>
            </td>
        </tr>
        <tr>
            <td>

            </td>
            <td>
                <?php echo "<span class='caption'>Location: </span> ". "<span class='val'>".$research->Observationdepth->Observation["location"]."</span>"?>
            </td>
            <td>
                <?php echo "<span class='caption'>Depth: </span> ". "<span class='val'>".$research->Observationdepth["observationdepth"].$research->Observationdepth->Unit["unit"]."</span>"?>
            </td>

        </tr>


        <tr>
            <td>

            </td>
            <td>
                <?php echo "<span class='caption'>Quantity: </span> ". "<span class='val'>".$research->getQuantity()."</span>"?>
            </td>
            <td>
                <?php echo "<span class='caption'>Unit: </span> ". "<span class='val'>".$research->Species->Unit["unit"]."</span>"?>
            </td>

        </tr>
        <tr>
            <td>

            </td>
            <td colspan="2">
                <?php echo "<span class='caption'>Contributor:</span> ". "<span class='val'>".$research->Observationdepth->Observation->Research->Researcher["firstname"]."</span>"?>
            </td>
            

        </tr>
        <tr>
            <td>

            </td>
            <td>
                <span class='caption'>Observation Date:</span>                <?php echo  "<span class='val'>".$research->Observationdepth->Observation["observationdate"]."</span>"?>
                
            </td>
            <td>

            </td>

        </tr>

        <tr>
            <td>

            </td>
            <td colspan="2">
                <?php echo "<span class='caption'>Tags: </span>" . "<span class='val'>".$research->Species->Tags["tag"]."</span>"?>

            </td>


        </tr>

</table>
</div>
<p>
    <?php endforeach?>



<?php else:?>
    (No Data Found)

<?php endif?>
